fix(gatsby): show theme that has faulty config #27708
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a user uses a theme that has a invalid plugin configuration in its gatsby-config.js, the user will see a blocking error:
However, the user doesn't even have
gatsby-plugin-mdx
in their gatsby-config and cannot fix this since they might not have control over the theme that incorrectly uses this plugin! 😱This patch fixes that case by instead 1) logging the directory of the faulty gatsby-config and 2) not blocking
yarn develop
if the error is from a gatsby-config outside the users root directory.Now, it looks like this:
This makes sure we don't block the user with errors they don't have control over.